package com.onemore.compare;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.voovan.http.server.HttpRequest;
import org.voovan.http.server.HttpResponse;
import org.voovan.tools.log.Logger;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.onemore.task.OneConfig;
import com.onemore.task.model.ModelGeneral;
import com.onemore.task.model.ModelOneErp2Wms;
import com.onemore.task.model.ModelOneErpThd;
import com.onemore.task.model.ModelSpjhd;

public class CompareErpThd  extends CompareBase{
	public static void process(HttpRequest req, HttpResponse resp) throws SQLException, InterruptedException
	{	
		String starDate = req.getParameter("starDate");
		String endDate = req.getParameter("endDate");
		List<Map<String, Object>> listSpjhd = new ArrayList<Map<String, Object>>();
		String sql = req.getParameter("sql");
		listSpjhd = ModelOneErpThd.getList(starDate,endDate);
		JSONObject jsonObject = new JSONObject();
		JSONArray jsonArray = new JSONArray();
		jsonArray.addAll(listSpjhd);
		jsonObject.put("data", jsonArray);
		String str = jsonObject.toJSONString();
		resp.write(str);
	}
	public static String getString() throws SQLException, InterruptedException
	{	
		List<Map<String, Object>> listSpjhd = ModelSpjhd.getCompare();
		return listSpjhd.toString();
	}
}
